<template>
  <canvas canvas-id="qrcode" style="width: 500rpx;height: 500rpx;" v-if="qrShow" />
</template>

<script>
import uQRCode from './uqrcode.js'
export default {
  props: [],
  data () {
    return {
      qrShow: false
    }
  },
  onLoad () {

  },
  methods: {
    qrFun: function (text, size = 250) {
      this.qrShow = true
      uQRCode.make({
        canvasId: 'qrcode',
        componentInstance: this,
        text,
        size,
        margin: 0,
        backgroundColor: '#ffffff',
        foregroundColor: '#000000',
        fileType: 'jpg',
        errorCorrectLevel: uQRCode.errorCorrectLevel.H,
        success: res => {}
      })
    },
    close () {
      this.qrShow = false
    }

  }
}
</script>

<style>

</style>
